package config

import "github.com/1141520944/go-library/hjz/common"

type Config struct {
	Server *ServerConf `mapstructure:"server"`
	Log    *LogConf    `mapstructure:"log"`
	Data   *DataConf   `mapstructure:"data"`
}
type ServerConf struct {
	Name string `mapstructure:"name"`
	Addr string `mapstructure:"addr"`
}
type LogConf struct {
	Name string `mapstructure:"name"`
	Path string `mapstructure:"path"`
}
type DataConf struct {
	K8s *K8s `mapstructure:"k8s"`
}
type K8s struct {
	Path string
}

var conf Config

func Init() (*Config, error) {
	err := common.InitViper("./config", &conf)
	return &conf, err
}
func Conf() *Config {
	return &conf
}
